import React, { useState } from 'react';
import {Button, Icon, Modal, Table, TableProps, Empty, Form, Select, Checkbox, Input} from 'antd';
type LayoutType = Parameters<typeof Form>[0]['layout'];
const { TextArea } = Input;
const App = (props) => {
  const [open, setOpen] = useState(false);
  const [confirmLoading, setConfirmLoading] = useState(false);
  const [form] = Form.useForm();
  const [formLayout, setFormLayout] = useState<LayoutType>('inline');
  const showModal = () => {
    setOpen(true);
  };

  const handleOk = () => {
    setConfirmLoading(true);
    setTimeout(() => {
      setOpen(false);
      setConfirmLoading(false);
    }, 2000);
  };

  const handleCancel = () => {
    setOpen(false);
  };

  React.useImperativeHandle(props.onRef, () => {
    return {
      showModal: showModal,
    };
  });
  return (
    <>
      <Modal
        title="作废原因"
        open={open}
        onOk={handleOk}
        confirmLoading={confirmLoading}
        onCancel={handleCancel}
        width={1200}
      >
        <div style={{display: 'flex'}}>
          <div style={{width: '130px'}}>作废原因：</div><Input />
        </div>
        <div style={{display: 'flex',marginTop: '10px'}}>
          <div style={{width: '130px'}}>其他原因:</div>
          <TextArea rows={4} />
        </div>
      </Modal>
    </>
  );
};

export default App;
